#ifndef __ORDERED_STD_UNIT_H__
#define __ORDERED_STD_UNIT_H__

#include <set>
#include <vector>
#include "AbstractUnit.h"
#include "UnitsVisitor.h"
#include "LengthUnit.h"

using namespace std;

template<typename Unit> class UnitDescendingOrderComp
{
public:
    bool operator()(const Unit* unitA, const Unit* unitB) const
    {
        return unitA->convertToBenchmark() > unitB->convertToBenchmark();
    }; 
};


class OrderedStdUnit
{
public:
	
	void accept( UnitsVisitor* visitor, const Unit* from = &MILE, const Unit* to = &INCH) const;

	const static OrderedStdUnit& getOrderedStdUnit();
	
private:

    OrderedStdUnit();
	
    typedef set<const Unit*, UnitDescendingOrderComp<Unit> > OrderedStdUnitSet;
	//typedef vector<const Unit*> OrderedStdUnitSet;
	OrderedStdUnitSet orderedStdUnitSet_m;
};


#endif
